package com.asiainfo.cms.common.security.userdetails;

import com.asiainfo.cms.common.vo.LoginUser;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.Map;

/**
 *  MyUserDetails 实体
 */
public class MyUserDetails extends User {

    private Map<String, Object> details;
    private LoginUser loginUser;

    public MyUserDetails(LoginUser user, Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), authorities);
        this.loginUser = user;
    }

    public LoginUser getLoginUser() {
        return loginUser;
    }

    public void setLoginUser(LoginUser loginUser) {
        this.loginUser = loginUser;
    }
}
